from osgeo import ogr

## Shapefile available?
driverName = "ESRI Shapefile"
drv = ogr.GetDriverByName( driverName )
if drv is None:
    print("%s driver not available.\n" % driverName)
else:
    print("%s driver IS available.\n" % driverName)